package com.tarry.chain;

public class ChainMain {
    public static void main(String[] args) {

        // 设置整个责任链
        CommonManager g= new CommonManager("G经理");
        Majordomo f = new Majordomo("F总监");
        GeneralManager generalManager = new GeneralManager("总经理");
        f.setSuperior(generalManager);
        g.setSuperior(f);


        Request request = new Request();
        request.setRequestType("请假");
        request.setRequestContent("张三请假");
        request.setNumber(2);
        g.handle(request);

        Request request2 = new Request();
        request2.setRequestType("请假");
        request2.setRequestContent("李四请假");
        request2.setNumber(4);
        g.handle(request2);

        Request request3 = new Request();
        request3.setRequestType("请假");
        request3.setRequestContent("王二请假");
        request3.setNumber(30);
        g.handle(request3);

        Request request4 = new Request();
        request4.setRequestType("加薪");
        request4.setRequestContent("张飞加薪");
        request4.setNumber(500);
        g.handle(request4);

        Request request5 = new Request();
        request5.setRequestType("加薪");
        request5.setRequestContent("李逵加薪");
        request5.setNumber(2500);
        g.handle(request5);



    }
}
